package com.mysoft.gfyx.marketdevelop.controller;

import com.mysoft.framework.modeling.dataapi.DataApi;
import com.mysoft.framework.mvc.api.Controller;
import com.mysoft.framework.rpc.annotation.PubAction;
import com.mysoft.framework.rpc.annotation.PubService;
import com.mysoft.framework.rpc.contants.RequestPrefix;
import com.mysoft.gfyx.marketdevelop.controller.dto.GetDetailDataRequestDto;
import com.mysoft.gfyx.marketdevelop.controller.dto.ViewTelNumberRequestDto;
import com.mysoft.gfyx.marketdevelop.mip.dto.GetDeveloperContactsRequestDto;
import com.mysoft.gfyx.marketdevelop.remoteService.RemoteProfitProvinceService;
import com.mysoft.gfyx.marketdevelop.service.ProvinceRadarService;
import com.mysoft.gfyx.marketdevelop.service.dto.PickContactsDto;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;
import java.util.List;

@PubService(value = "/provinceRadarDataApi", prefix = RequestPrefix.API)
@Tag(name = " 省市雷达-API")
public class ProvinceRadarDataApiController extends Controller implements DataApi {

    @Resource
    private ProvinceRadarService provinceRadarService;

    @Resource
    private RemoteProfitProvinceService provinceService;

    //获取高级筛选字段组+字段元数据
    @PubAction(value = "/viewTelNumber", method = RequestMethod.POST)
    public boolean viewTelNumber(@RequestBody ViewTelNumberRequestDto viewTelNumberRequestDto) {
        provinceRadarService.viewTelNumber(viewTelNumberRequestDto.getTelNumber());
        return true;
    }

    //线索雷达，联系人
    @PubAction(value = "/getContacts", method = RequestMethod.POST)
    public List<PickContactsDto> getContacts(@RequestBody GetDeveloperContactsRequestDto getDeveloperContactsRequestDto) {
        return provinceRadarService.getContacts(getDeveloperContactsRequestDto);
    }

    //线索雷达，获取联系人手机号明文
    @PubAction(value = "/getContactMobile", method = RequestMethod.POST)
    public PickContactsDto getContactMobile(@RequestBody GetDetailDataRequestDto getDetailDataRequestDto) {
        return provinceRadarService.getContactMobile(getDetailDataRequestDto);
    }
}
